<?php
/**
 * @var $model User
 * @var $this UserController
 */
$this->breadcrumbs = array(
    //'Tài khoản' => array('profile'),
    $model->username,
);
$this->pageTitle = $model->username;
?>
<h2 style="background:#EFB632;color: #000;padding: 3px 0px 3px 20px;font-size: 13px;font-weight: bold">Thông tin tài
    khoản <?php echo $model->checkOwn() ? "[" . CHtml::link('Sửa', $this->createUrl('edit'), array('title' => 'Sửa thông tin cá nhân')) . "]" : ""; ?></h2>
<div class="form">
    <table>
        <tr>
            <td colspan="2" style="padding-left: 20px;font-weight: bold;">Thông tin tài khoản</td>
        </tr>
        <tr>
            <td style="text-align: right">Mã số tài khoản:</td>
            <td><strong><?php echo $model->id; ?></strong></td>
        </tr>
        <tr>
            <td style="text-align: right">Tài khoản:</td>
            <td><?php echo $model->username; ?></td>
        </tr>
        <tr>
            <td style="text-align: right">Mật khẩu:</td>
            <td>
                *****  <?php echo $model->checkOwn() ? "[" . CHtml::link('Cập nhật', $this->createUrl('changepass')) . "]" : "" ?></td>
        </tr>
        <tr>
            <td style="text-align: right">Email đăng ký:</td>
            <td><?php echo $model->email; ?></td>
        </tr>
        <tr>
            <td colspan="2" style="border-bottom: 1px solid #ccc;"></td>
        </tr>
        <tr>
            <td colspan="2" style="padding-left: 20px;font-weight: bold;padding-top: 10px;">Thông tin cá nhân</td>
        </tr>

        <tr>
            <td style="text-align: right">Họ tên:</td>
            <td><?php echo $model->display_name; ?></td>
        </tr>
        <tr>
            <td style="text-align: right">Giới tính:</td>
            <td><?php echo $model->sex == 1 ? "Nam" : "Nữ"; ?></td>
        </tr>
        <tr>
            <td style="text-align: right">Ngày sinh:</td>
            <td><?php echo date('d/m/Y', $model->birthday); ?></td>
        </tr>
        <tr>
            <td style="text-align: right">Điện thoại:</td>
            <td><?php echo $model->tel; ?></td>
        </tr>
        <tr>
            <td style="text-align: right">Địa chỉ:</td>
            <td><?php echo $model->address; ?></td>

        </tr>
        <tr>
            <td style="text-align: right">Home page:</td>
            <td><?php echo $model->home_page; ?></td>
        </tr>
        <?php if ($gclasses): ?>
        <tr>
            <td colspan="2" style="border-bottom: 1px solid #ccc;"></td>
        </tr>
            <tr><td colspan="2" style="padding-left: 20px;font-weight: bold;padding-top: 10px;">Các lớp bạn tham gia</td></tr>
                <?php foreach($gclasses as $cls): ?>
            <tr><td style="padding-left: 20px;"> - <?php echo $cls->title; ?></td><td><?php if($cls->start_time < time()){ echo CHtml::ajaxLink('Hủy',$this->createUrl('delclass',array('id'=>$cls->id)),array('success'=>'js:function(){window.location.reload();}'));} ?></td></tr>
            <?php endforeach;?>
        <?php endif;?>
    </table>
</div>